import numpy as np


# 重塑数组
arr = np.arange(12)
new_arr = arr.reshape(3, 4)  # 转换为3行4列的数组
print(f"arr:{arr}\nnew_arr:\n{new_arr}\n")

# 合并数组
a = np.array([1, 2, 3])
b = np.array([4, 5, 6])
c = np.concatenate([a,b])
print(f"c:\n{c}\n")

# 垂直堆叠（按行）
new_a = a.reshape(1,3)
new_b = b.reshape(1,3)
d = np.vstack([new_a,new_b])
print(f"d:\n{d}\n")















